//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#include "Utils/Converter/ResourceConverter.h"

namespace Engine {
namespace Base {
	typedef UX_STL::UXTypes::Library	Library;
}}

using namespace Engine;
using namespace Utils;

#include "Utils/Converter/Converter.h"


struct _SResourceConverterInstance
{
	UtilsCore			core;
	ResourceConverter	resConv;
	///
	_SResourceConverterInstance () : resConv(&core) {}
};


// CreateResourceConverter
extern "C" bool UX_DLL_EXPORT CreateResourceConverter (const char *path, const char *log, ResourceConverterInstance &rc)
{
	rc = (ResourceConverterInstance) new _SResourceConverterInstance();
	return ((_SResourceConverterInstance *)rc)->core.Init( path, log, false );
}

// DestroyResourceConverter
extern "C" void UX_DLL_EXPORT DestroyResourceConverter (ResourceConverterInstance rc)
{
	delete (_SResourceConverterInstance *) rc;
}

// ConvertResources
extern "C" bool UX_DLL_EXPORT ConvertResources (ResourceConverterInstance rc, const char *config)
{
	return ((_SResourceConverterInstance *)rc)->resConv.LoadConfig( config );
}


int main (int argc, char *argv[])
{
	UtilsCore	core;

	core.Init( "Engine", "log.html", false );

	ResourceConverter	res_conv( &core );

	res_conv.LoadConfig( "_res/res_converter.ocf" );

	return 0;
}
